package com.odm.communitymanage.ui.health

import android.widget.RadioButton
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.odm.communitymanage.R
import com.odm.communitymanage.core.bean.HealthSituationOptions

/**
 * @description: 健康情况列表 适配器
 * @author: ODM
 * @date: 2020/4/14
 */

class HealthOptionsAdapter (data : MutableList<HealthSituationOptions>)
    : BaseQuickAdapter<HealthSituationOptions, BaseViewHolder>(R.layout.item_health_options, data) {

    override fun convert(holder: BaseViewHolder, item: HealthSituationOptions) {
        holder.setText(R.id.tv_health_option  , item.situation)
        holder.getView<RadioButton>(R.id.checkbox_health_option).isChecked = item.isSelected
    }
}